package com.taxi.driver.data.config.local;

import com.qianxx.utils.SP;
import com.taxi.driver.data.config.ConfigSource;
import com.taxi.driver.data.entity.ConfigEntity;
import com.taxi.driver.data.entity.GovernEntity;

import java.util.List;

import javax.inject.Inject;

import rx.Observable;

public class ConfigLocalSource implements ConfigSource {

    private SP mSP;
    private final static String ABOUT = "about";
    private final static String PRICERULES = "priceRules";
    private final static String RULEEXPLAIN = "ruleExplain";
    private final static String AGRESS = "agress";

    @Inject
    public ConfigLocalSource(SP sp) {
        mSP = sp;
    }

    @Override
    public Observable<List<ConfigEntity>> variable() {
        return null;
    }

    @Override
    public Observable<GovernEntity> getGovern() {
        return null;
    }

    @Override
    public void saveAbout(String value) {
        mSP.putString(ABOUT, value);
    }

    @Override
    public String getAbout() {
        return mSP.getString(ABOUT, "");
    }

    @Override
    public void savePriceRules(String value) {
        mSP.putString(PRICERULES, value);
    }

    @Override
    public String getPriceRules() {
        return mSP.getString(PRICERULES, "");
    }

    @Override
    public void saveRuleExplain(String value) {
        mSP.putString(RULEEXPLAIN, value);
    }

    @Override
    public String getRuleExplain() {
        return mSP.getString(RULEEXPLAIN, "");
    }

    @Override
    public void saveAgress(String value) {
        mSP.putString(AGRESS, value);
    }

    @Override
    public String getAgress() {
        return mSP.getString(AGRESS, "");
    }

    @Override
    public Observable<String> removePayCache(String orderUuid) {
        return null;
    }

    @Override
    public Observable<String> payCallback(String orderUuid) {
        return null;
    }
}